package _image

import (
	"bytes"
	"image"
	"image/png"
	"io"
)

type pngHelper struct {
}

func (r pngHelper) Decode(data []byte) (image.Image, error) {
	return png.Decode(bytes.NewReader(data))
}
func (r pngHelper) Encode(writer io.Writer, img image.Image) error {
	return png.Encode(writer, img)
}

// func (r pngHelper) Encode(img image.Image) (bytes.Buffer, error) {
// 	buf := bytes.Buffer{}
// 	err := png.Encode(&buf, img)
//
// 	return buf, err
// }

// DefaultCompression CompressionLevel = 0
// NoCompression      CompressionLevel = -1
// BestSpeed          CompressionLevel = -2
// BestCompression    CompressionLevel = -3
